# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=py3-librelingo-yaml-loader
pkgver=1.12.0
pkgrel=0
pkgdesc="Load YAML-based LibreLingo courses in your Python project"
url="https://github.com/LibreLingo/LibreLingo"
arch="noarch"
license="AGPL-3.0-only"
depends="
	py3-bleach
	py3-bleach-allowlist
	py3-click
	py3-html2markdown
	py3-librelingo-types
	py3-markdown
	py3-pyfakefs
	py3-slugify
	py3-yaml
	python3
	"
makedepends="
	py3-gpep517
	py3-poetry-core
	py3-wheel
	"
checkdepends="
	py3-pytest
	py3-snapshottest
	"
subpackages="$pkgname-pyc"
source="https://pypi.python.org/packages/source/l/librelingo_yaml_loader/librelingo_yaml_loader-$pkgver.tar.gz"
options="!check" # No tests in the PyPi package
builddir="$srcdir/librelingo_yaml_loader-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
57c0489cfcf7f94f0ea0e1bf70fce46ab6187dc194167c87fa853ed5477b34accb73132ecd884775d6171794e3e9ada67ef0b8fd960db0a84cab207642b32e84  librelingo_yaml_loader-1.12.0.tar.gz
"
